#include "hot_refresh_demo_plugin.h"
#include <QPushButton>

#include "form.h"

Hot_refresh_demo_plugin::Hot_refresh_demo_plugin()
    :mGenWidget(Q_NULLPTR)
{

}

Hot_refresh_demo_plugin::~Hot_refresh_demo_plugin()
{
    if(mGenWidget){
        mGenWidget->deleteLater();
    }
}

QWidget *Hot_refresh_demo_plugin::rootWidget()
{
    if(!mGenWidget){
        mGenWidget=new Form();
    }
    return mGenWidget;
}

int Hot_refresh_demo_plugin::addFun(int value1, int value2)
{
    return (value1 + value2);
}

int Hot_refresh_demo_plugin::subFun(int value1, int value2)
{
    return (value1 - value2);
}

extern "C" {
    HOT_REFRESH_DEMO_PLUGIN_EXPORT Hot_refresh_demo_plugin* createHotRefreshDemoPluginInstance() {
        return new Hot_refresh_demo_plugin();
    }
}


extern "C" {
    HOT_REFRESH_DEMO_PLUGIN_EXPORT int addFun(int value1, int value2)
    {
            return (value1 + value2);
    }

    HOT_REFRESH_DEMO_PLUGIN_EXPORT int subFun(int value1, int value2)
    {
            return (value1 - value2);
    }

    HOT_REFRESH_DEMO_PLUGIN_EXPORT QWidget* rootWidget()
    {
            return new Form();
    }


}
